package com.heh.mybatisplus.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.heh.mybatisplus.config.JsonTypeHandler;
import com.heh.mybatisplus.config.MyFastjsonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * @项目名： spring-emq
 * @包名： com.heh.mybatisplus.model
 * @文件名: EmpId
 * @创建者: liufudong@szyh-smart.com
 * @创建时间: 2024/10/20 11:33
 * @描述：
 */
//@Data
//@Accessors(chain = true)
//@AllArgsConstructor
//@NoArgsConstructor
//@TableName(value = "emp_id",autoResultMap = true)
//@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
@Accessors(chain = true)
@ToString(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@TableName(autoResultMap = true, value = "emp_id")
public class EmpId implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField(value = "EMPNO")
    @Schema(description = "")
    private Integer empno;

    @TableField(value = "ENAME")
    @Schema(description = "")
    private String eName;

    @TableField(value = "JOB")
    @Schema(description = "")
    private String job;

    @TableField(value = "MGR")
    @Schema(description = "")
    private Integer mgr;

    @TableField(value = "HIREDATE")
    @Schema(description = "")
    private Date hireDate;

    @TableField(value = "SAL")
    @Schema(description = "")
    private Double sal;

    @TableField(value = "COMM")
    @Schema(description = "")
    private Double comm;

    @TableField(value = "DEPTNO")
    @Schema(description = "")
    private Integer deptno;

    @TableField(value = "create_time")
    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date createTime;

    /**
     * 配置信息，json格式
     */
//    @TableField(typeHandler = MyFastjsonTypeHandler.class,value = "json")
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private JsonDTO json;
}
